import {Entity,  Column, PrimaryGeneratedColumn,OneToOne,JoinColumn} from "typeorm";
import { DynamicInfoEntity } from "./DynamicInfoEntity";
import {UserEntity} from './UserEntity'

@Entity("dynamic")
export class DynamicEntity{

    @PrimaryGeneratedColumn()
    dynamic_Id!: number;
    
	@Column()
    dynamic_Img!: string;

    @Column()
    dynamic_Time!: Date;

    @Column({length:500})
    dynamic_Introduce!: string;

    @Column()
    dynamic_ShareCount!: number;

    @Column()
    dynamic_CommentCount!: number;

    @Column()
    dynamic_WatchCount!: number;
    
    @Column()
    dynamic_LikeCount!: number;

    @Column()
    dynamic_CollectionCount!: number;

    @OneToOne(()=>UserEntity)
    @JoinColumn()
    dynamic_User!:UserEntity;

    @OneToOne(()=>DynamicInfoEntity)
    @JoinColumn()
    dynamic_Info!:DynamicInfoEntity;

    @Column()
    dynamicUserUserId!:number;

    @Column()
    dynamicInfoDynamicInfoId!:number;


    @Column({length:500})
    dynamic_TagList!:string ;

    @Column()
    isLike:boolean = false;

    @Column()
    isCollection:boolean = false;

}